package com.csr;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.LinearLayout;
import android.widget.TextView;

public class ComingSoon extends Activity 
{
	Button btnLogout,btnBack;
	TextView tveaderText;
	public void onCreate(Bundle savedInstanceState) 
	{
        super.onCreate(savedInstanceState);
        setContentView(R.layout.tab);
        
        Bundle bundle=getIntent().getExtras(); 
		if(!bundle.isEmpty())
		{
			if(bundle.getBoolean("istabactivity"))
			{
				LinearLayout ll=(LinearLayout)findViewById(R.id.headerlayout);
				ll.setVisibility(LinearLayout.GONE);
			}
		}
        
        btnLogout=(Button)findViewById(R.id.btnLogout);
        btnBack=(Button)findViewById(R.id.btnPrevious);
        tveaderText=(TextView)findViewById(R.id.tv_headerText);
        
        tveaderText.setVisibility(TextView.INVISIBLE);
        btnBack.setVisibility(Button.GONE);
        btnLogout.setOnClickListener(new OnClickListener()
		{
			
			public void onClick(View v) 
			{
				new AlertDialog.Builder(ComingSoon.this)
		        .setTitle( "Exit Application" )
		        .setMessage( "Are you sure you want to Logout?" )
		        .setPositiveButton("YES", new android.content.DialogInterface.OnClickListener() 
		        {
		            public void onClick(DialogInterface arg0, int arg1) 
		            {
		                //do stuff onclick of YES
		            	setResult(2);
		            	finish();
		            }

					public void onClick(View v) 
					{
						// TODO Auto-generated method stub
						
					}
		        })
		        .setNegativeButton("NO",  new android.content.DialogInterface.OnClickListener() {
		            public void onClick(DialogInterface arg0, int arg1)
		            {
		                //do stuff onclick of CANCEL
		            	arg0.dismiss();
		               
		            }

					public void onClick(View v) 
					{
						// TODO Auto-generated method stub
					}
		        }).show();
				  		
			}
		});
        
      
	}

	@Override
	public void onBackPressed() 
	{
		// TODO Auto-generated method stub
		
		new AlertDialog.Builder(ComingSoon.this)
        .setTitle( "Exit Application." )
        .setMessage( "Are you sure you want to Exit ?" )
        .setPositiveButton("YES", new android.content.DialogInterface.OnClickListener() 
        {
            public void onClick(DialogInterface arg0, int arg1) 
            {
                //do stuff onclick of YES
            	finish();
            }
            
			public void onClick(View v) 
			{
				// TODO Auto-generated method stub
				
			}
			
        })
        .setNegativeButton("NO",  new android.content.DialogInterface.OnClickListener()
        {
        	public void onClick(DialogInterface arg0, int arg1)
            {
                //do stuff onclick of CANCEL
            	arg0.dismiss();
            }

			public void onClick(View v) 
			{
				// TODO Auto-generated method stub
			}
        }).show();
	}
}
